import request from '@/utils/request'
import { downFile } from '@/utils/request'

/**
 * AI提示内容维护分页查询
 * @param {查询条件} data
 */
export function listGbAiPrompt(query) {
  return request({
    url: 'Buss/GbAiPrompt/list',
    method: 'get',
    params: query,
  })
}

/**
 * 新增AI提示内容维护
 * @param data
 */
export function addGbAiPrompt(data) {
  return request({
    url: 'Buss/GbAiPrompt',
    method: 'post',
    data: data,
  })
}
/**
 * 修改AI提示内容维护
 * @param data
 */
export function updateGbAiPrompt(data) {
  return request({
    url: 'Buss/GbAiPrompt',
    method: 'PUT',
    data: data,
  })
}
/**
 * 获取AI提示内容维护详情
 * @param {Id}
 */
export function getGbAiPrompt(id) {
  return request({
    url: 'Buss/GbAiPrompt/' + id,
    method: 'get'
  })
}

/**
 * 删除AI提示内容维护
 * @param {主键} pid
 */
export function delGbAiPrompt(pid) {
  return request({
    url: 'Buss/GbAiPrompt/delete/' + pid,
    method: 'POST'
  })
}
// 清空AI提示内容维护
export function clearGbAiPrompt() {
  return request({
    url: 'Buss/GbAiPrompt/clean',
    method: 'POST'
  })
}
// 导出AI提示内容维护
export async function exportGbAiPrompt(query) {
  await downFile('Buss/GbAiPrompt/export', { ...query })
}
